package day1105.second;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import static day1105.common.MyUtil.printLine;

/**
 * @author Mr.ma
 * @since 2022/11/6 16:41
 **/
public class ConcatTest {
    public static void main(String[] args) {
        printLine("拆分字符串数组，并去重");
        String[] arrStr = new String[]{"hello","world"};
        List<String[]> collect = Arrays.stream(arrStr).map(x -> x.split("")).collect(Collectors.toList());
        List<String> collect1 = Stream.concat(Arrays.stream(collect.get(0)), Arrays.stream(collect.get(1).clone())).distinct().collect(Collectors.toList());
        System.out.println("collect1 = " + collect1);
    }
}
